<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Association Details</title>
</head>
<body>
	<h1>Association Details</h1>
	<form:form id="associationForm" action="association-form.html" commandName="association">
		<form:hidden path="id"/>
		<form:hidden path="containerClassId"/>
		<table>
			<tr>
				<th>Association Type</th>
				<td>
					<form:select path="associationType">
						<form:option value="Aggregation">Aggregation</form:option>
						<form:option value="Composition">Composition</form:option>
					</form:select>
				</td>
				<td></td>
			</tr>
			<tr>
				<th>Association Multiplicity</th>
				<td>
					<form:select path="associationMultiplicity">
						<form:option value="OneToOne">OneToOne</form:option>
						<form:option value="OneToMany">OneToMany</form:option>
					</form:select>
				</td>
				<td></td>
			</tr>
			<tr>
				<th>Contained Class</th>
				<td>
					<form:select path="containedClassId">
						<form:options items="${allClassList}" itemValue="id" itemLabel="className"/>
					</form:select>
				</td>
				<td></td>
			</tr>			
			<tr>
				<th>Attribute Name</th>
				<td><form:input path="attributeName"/></td>
				<td></td>
			</tr>
			<tr>
				<th>FK Attribute Name</th>
				<td><form:input path="foreignKeyAttributeName"/></td>
				<td></td>
			</tr>
			<tr>
				<th>FK Column Name</th>
				<td><form:input path="foreignKeyColumnName"/></td>
				<td></td>
			</tr>
		</table>
		<input type="button" value="Cancel" onclick="javascript:location.href='association-list.html?method=list&containerClassId=<c:out value="${association.containerClassId}"/>'"/>
		<input type="submit" value="Save"/>
	</form:form>
</body>
</html>